﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="connDbBean" scope="page" class="com.util.db"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="js/popup.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<TITLE>帖子查询</TITLE>
	<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="ny/js/jquery.min.js"></script>
<script type="text/javascript" src="ny/js/bootstrap.min.js"></script>
<script src="ny/js/jconfirm/jquery-confirm.min.js"></script>
<link href="ny/css/bootstrap.min.css" rel="stylesheet">
<link href="ny/css/materialdesignicons.min.css" rel="stylesheet">
<link href="ny/css/style.min.css" rel="stylesheet">
<link rel="stylesheet" href="ny/js/jconfirm/jquery-confirm.min.css">
	</head>
	
	<body>
	<div class="card">
              <div class="card-header"><h4>帖子列表</h4></div>
              <div class="card-body">
			   <form class="form-inline" action="" method="post">
                  <div class="form-group">
                        标题：<input name="biaoti" type="text" id="biaoti" class='form-control' />
                  </div>
                  <div class="form-group">
                    <button class="btn btn-default" type="submit">搜索</button>
                  </div>
                </form>
            
 <table class="table table-hover">
  <thead>
  <tr>
    <th>序号</th>
    <th>标题</th>
    <th>主贴/回帖</th>
    <th>发布人</th>
    <th align="center"><div align="center">操作</div></th>
  </tr>
  </thead>
   <tbody>
   <%int i=0;%>
   <c:forEach items="${list}" var="u">
       <%i++;%>
  <tr>
    <td ><%=i%></td>
    <td>${u.biaoti}</td>
    <td> <c:if test="${u.fid=='0'}">主贴</c:if>
        <c:if test="${u.fid!='0'}">回帖</c:if></td>
    <td>${u.faburen}</td>
    <td align="center"><a class="btn btn-primary"  onClick="activity_del('${u.id }')" style="cursor:pointer"> <i class="mdi mdi-close"></i>删除</a> 
	    <a class="btn btn-warning" href="doUpdateTiezi.do?id=${u.id }"><i class="mdi mdi-delete-empty"></i>修改</a>
        <c:if test="${u.fid=='0'}">
        <a class='btn btn-info' href="tiezidetail.jsp?id=${u.id }"  ><i class='mdi mdi-arrow-expand-all'></i>详细</a></c:if>
        <c:if test="${u.fid!='0'}">
        <a class='btn btn-info' href="tiezidetail.jsp?id=${u.fid }"  ><i class='mdi mdi-arrow-expand-all'></i>详细</a></c:if>
    </td>
  </tr>
  	  </c:forEach>
  </tbody>
</table>

 <nav>
                  <ul class="pagination pagination-circle" style="width:95%">
                    <li 
					<c:if test="${page.page==1}">
					  class="disabled" style="pointer-events: none;"
					 </c:if>
					
					>
                      <a href="tieziList.do?page=${page.page-1 }">
                        <span><i class="mdi mdi-chevron-left"></i></span>
                      </a>
                    </li>
					<c:forEach var="x" begin="1" end="${page.totalPage}" step="1">
                    <li <c:if test="${page.page==x}">
                    class='active'"
	</c:if> ><a href="tieziList.do?page=${x}">${x}</a></li>
				    </c:forEach>
                    <li>
                      <a href="tieziList.do?page=${page.page+1 }">
                        <span><i class="mdi mdi-chevron-right"></i></span>
                      </a>
                    </li><button class="btn btn-danger" type="button" style="float:right" onclick="javascript:location.href='tiezi_listxls.jsp';" >导出excel</button><button class="btn btn-success m-r-5" type="button" onclick="window.print();" style="float:right">打印本页</button>
                  </ul>
                </nav>
				
				

	 
  </div>
</div>
<script language="javascript">
function activity_del(nid)
{
  $.confirm({
        title: '确认对话框',
        content: '您确定要删除？',
        buttons: {
            confirm: {
                text: '确认',
                action: function(){
                    location.href="deleteTiezi.do?id="+nid;
                }
            },
            cancel: {
                text: '关闭',
                action: function(){
                   // $.alert('取消的!');
                }
            },
            
        }
    });
}
</script>			
			
			
	</body>
</html>

